import { Login, Logout } from "../constants";

const initValues = {
  token: ''
}

export default function login(prevState = initValues, action) {
  switch (action.type) {
    case Login:
      return { ...prevState, token: action.payload }
    case Logout:
      return { ...prevState, token: '' }
    default:
      return prevState
  }
}